﻿@model ProjectManager.Models.User

<h2>User Edit</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>User</legend>

        @Html.HiddenFor(m => m.UserID)

		<div class="editor-label">
			@Html.LabelFor(m => m.UserName)
        </div>

        <div class="editor-field">
			@Html.EditorFor(m => m.UserName)
            @Html.ValidationMessageFor(m => m.UserName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(m => m.Email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(m => m.Email)
            @Html.ValidationMessageFor(m => m.Email)
        </div>

		<div class="editor-label">
            @Html.LabelFor(m => m.Role)
        </div>
        <div class="editor-field">
			@Html.DropDownList("Role", (IEnumerable<SelectListItem>) ViewData["Roles"])
        </div>
		
		<div class="editor-label">
            @Html.LabelFor(m => m.Comment)
        </div>
        <div class="editor-field">
            @Html.EditorFor(m => m.Comment)
            @Html.ValidationMessageFor(m => m.Comment)
        </div>

		<div class="editor-label">
            @Html.LabelFor(m => m.IsLockedOut)
        </div>
        <div class="editor-field">
            @Html.EditorFor(m => m.IsLockedOut)
            @Html.ValidationMessageFor(m => m.IsLockedOut)
        </div>

		<div class="editor-label">
            @Html.LabelFor(m => m.CreationDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(m => m.CreationDate)
            @Html.ValidationMessageFor(m => m.CreationDate)
        </div>        

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

